package com.study.it.entity;

import java.io.Serializable;
import java.util.List;

public class PageInfo<T> implements Serializable {
	private List<T> list=null;//对象集合
	private int dataCount;//总行数
	private int row;//每页多少行
	private int currentPage;//当前是第几页
	public  boolean isLastPage()
	{
		return this.currentPage>=this.getPageCount();
	}
	public  boolean isFirstPage()
	{
		return this.currentPage<=1;
	}
	
	public int getNextPage()
	{
		return this.currentPage>=this.getPageCount()?this.currentPage:this.currentPage+1;
	}
	public int getPrevPage()
	{
		return this.currentPage<=1?1:this.currentPage-1;
	}
	
	public List<T> getList() {
		return list;
	}
	public void setList(List<T> list) {
		this.list = list;
	}
	public int getDataCount() {
		return dataCount;
	}
	public void setDataCount(int dataCount) {
		this.dataCount = dataCount;
	}
	public int getPageCount() {
		return (dataCount%row==0)?(dataCount/row):(dataCount/row+1);
	}
	public int getRow() {
		return row;
	}
	public void setRow(int row) {
		this.row = row;
	}
	public int getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	
	
}
